<h1>Edit User</h1>
<p>Please enter the users information below.</p>
<?php if(!empty($message)) {?>
<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo $message;?></div>
<?php }?>
<?php echo form_open(current_url());?>
<table width="60%" align="center" class="table-condensed">  
        <tr>
          <td width="31%"> <b>Product name: </b></td>
          <td colspan="2"><?php echo form_input($name);?></td>
        </tr>
       <tr>
          <td width="31%"><b>Product Code:</b> </td>
          <td colspan="2"><?php echo form_input($code);?></td>
        </tr>
       
       
           <tr>
         	 <td width="31%"><b>Category:</b> </td>
          	<td colspan="2">
            	  <?php 
	 	$bl[0] = "";
			foreach($categories as $category){
				$bl[$category->id] = $category->name;
				
			}
			echo form_dropdown('id_category', $bl, $user->id_category, 'class="chzn-select" data-placeholder="Choose a Category" ');  ?>
           </td>
        </tr>
       <tr>
         	 <td width="31%"><b>Company:</b> </td>
          	<td colspan="2">
            	  <?php 
	 	$bl[0] = "";
			foreach($companies as $company){
				$bl[$company->id] = $company->name;
				
			}
			echo form_dropdown('id_company', $bl, $user->id_company, 'class="chzn-select" data-placeholder="Choose a Company" ');  ?>
           </td>
        </tr>
           <tr>
          <td width="31%"><b>Selling Price:</b> </td>
          <td colspan="2"><?php echo form_input($selling_price);?></td>
        </tr>
        
        <tr>
          <td width="31%"><b>Purhase Price: </b></td>
          <td colspan="2"><?php echo form_input($purchase_price);?>
		  </td>
       		
	    </tr>
        
        <tr>
          <td width="31%"><b>opening_stock: </b></td>
          <td colspan="2"><?php echo form_input($opening_stock);?></td>
        </tr>
		<tr>
         <td><b> Unit</b></td>
         <td>   <?php 
	 	$bl[0] = "";
	   		foreach($units as $unit){
				$bl[$unit->id] = $unit->name;
			}
		echo form_dropdown('id_unit', $bl, $user->id_unit, 'class="chzn-select" data-placeholder="Choose a Company" ');  ?>
	</td>     
      </tr>
	  <tr>
		<td></td><td><input type="hidden" name="id_branch" value="<?php echo $user->id_branch;?>"></td>
	 </tr>
		
	<!-- <tr>
         <td><b> Branch</b></td>
         <td>   <?php 
	 	$b4[0] = "Warehouse";
	   		foreach($branches as $branch){
				$b4[$branch->id] = $branch->name;
			}
			echo form_dropdown('id_branch', $b4,"0",'class="chzn-select"  style="width:220px;"');  ?>
		</td>
	</tr> --> 
        
        <tr>
          <td width="31%"><b>Alert Quantity: </b></td>
          <td colspan="2"><?php echo form_input($alert_quantity);?></td>
        </tr>
        <tr>
           <td>
	            <?php echo form_hidden('id', $user->id);?> 
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td><td><?php echo form_submit($submit,'class="btn btn-success"');?></td>
  </tr>
</table>
<?php echo form_close();?>
